<?php
namespace app\erp\validate;

use think\Validate;

class Invoicerule extends Validate
{

    protected $rule = [
        'invoice_type' => 'require',
        'invoice_title' => 'require',
        'invoice_duty' => 'require',
        'invoice_money' => 'require|number|min:0.01'
    ];

    protected $message = [
        'invoice_type.require' => '发票类型错误',
        'invoice_title.require' => '请输入发票抬头',
        'invoice_duty.require' => '请输入发票税号',
        'invoice_money.require' => '发票金额不对',
        'invoice_money.number' => '发票金额不对',
        'invoice_money.min' => '发票金额不对',
        'invoice_addr.require' => '请输入地址',
        'invoice_tel.require' => '请输入电话',
        'invoice_bank.require' => '请输入开户银行',
        'invoice_account.require' => '请输入开户户名'
    ];

    protected $scene = [
        'type3' => [
            'invoice_addr' => 'require',
            'invoice_tel' => 'require',
            'invoice_bank' => 'require',
            'invoice_account' => 'require'
        ]
    ];
}